package com.oyo.common.enums;

/**
 * 费用类型
 */
public enum FeeType {
    RECEIVABLE(0, "应收"),
    RECEIPTS(1, "实收");

    Integer code;
    String name;

    FeeType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String fromCode(Integer code) {
        FeeType[] types = values();
        for (FeeType type : types) {
            if (type.getCode().equals(code)) {
                return type.getName();
            }
        }
        return null;
    }

}
